﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Home.aspx.cs" Inherits="MyVocationSpace.Home"
    Theme="Default" %>

<%@ Register Src="Header.ascx" TagName="header" TagPrefix="uc" %>
<%@ Register Src="Footer.ascx" TagName="footer" TagPrefix="uc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>..:: MY VocationSpace ::..</title>
    <link href="css/Default.css" rel="stylesheet" type="text/css" />
    <script src="js/jquery-1.7.1.min.js" type="text/javascript"></script>
    <%-- <link rel="stylesheet" href="http://code.jquery.com/ui/1.8.21/themes/base/jquery-ui.css"
        type="text/css" media="all" />--%>
    <link href="css/jquery-ui.css" rel="stylesheet" type="text/css" />
    <link href="css/Popup.css" rel="stylesheet" type="text/css" />
    <script src="js/Popup.js" type="text/javascript"></script>
    <script type="text/javascript">
        var strFlagIndVac = '0';
        function PopupList(flag) {
            if (flag != '') {
                strFlagIndVac = flag;
            }
            var strSearch = document.getElementById("txtSearch").value;
            if (flag != null) {
                if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari
                    xmlhttp = new XMLHttpRequest();
                }
                else {// code for IE6, IE5
                    xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
                }
                xmlhttp.onreadystatechange = function () {
                    if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
                        $('#loading').fadeOut("slow");
                        if (flag != 0) {
                            $("#List-Head").html('<b>Browse Members by Industry</b>');
                        }
                        else {
                            $("#List-Head").html('<b>Browse Members by Vocation</b>');
                        }

                        $('#PopupList').html(xmlhttp.responseText);
                    }
                }
                xmlhttp.open("POST", "AJAX/GetAllIndustryAndVocation.aspx?flag=" + strFlagIndVac + "&strSearch=" + strSearch, true);
                xmlhttp.send();
                $('#loading').fadeIn("slow");
            }
        }
    </script>
    <script type="text/javascript">
        function sendPassword() {
            var txtEmail = document.getElementById("txtEmailAdd").value;
            if (txtEmail != "") {
                if (validate(txtEmail)) {
                    var xmlhttp;
                    if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari
                        xmlhttp = new XMLHttpRequest();
                    }
                    else {// code for IE6, IE5
                        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");

                    }
                    xmlhttp.onreadystatechange = function () {
                        if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {

                            document.getElementById("loading").style.display = "none";
                            document.getElementById("ErrorDiv").style.display = "block";
                            document.getElementById("ErrorDiv").innerHTML = xmlhttp.responseText;
                            document.getElementById("txtEmailAdd").value = "";
                        }
                    }
                    xmlhttp.open("POST", "AJAX/SendPassword.aspx?EmailID=" + txtEmail + "&type=0", true);
                    xmlhttp.send();
                    document.getElementById("loading").style.display = "block";
                }
                else {

                    document.getElementById("div7").innerHTML = "Invalid Email ID.";
                    toggleDiv('div7', 1);
                    return false;
                }

            }
            else {

                document.getElementById("div7").innerHTML = "Invalid Email ID.";
                toggleDiv('div7', 1);
                return false;
            }
        }
        function clearOnFocus() {
            document.getElementById("idSpanMsg").style.display = "none";
        }
    </script>
    <script type="text/javascript">
        function validateGo() {

            var indu = document.getElementById("txtIndustry");
            var voc = document.getElementById("txtVocation");
            var spanGo = document.getElementById("spanGoErr");

            if ((indu.value == 'Enter industry name' || indu.value == '') && (voc.value == 'Enter vocation' || voc.value == '')) {
                spanGo.style.display = "block";
                spanGo.innerHTML = "Enter Industry or Vocation";
                return false;
            }
        }
    
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <center>
        <div>
            <uc:header ID="header" runat="server" />
        </div>
        <div id="content-wrapper">
            <center>
                <div class="Content">
                    <div id="about">
                        <table width="550px">
                            <tr>
                                <td colspan="2" class="Atextclass">
                                    Over 150 million professionals use MyVocationspace to exchange information, ideas
                                    and opportunities
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <img src="Images/img-home1.png" height="60" width="60" />
                                </td>
                                <td align="left">
                                    <span style="font-family: Arial; width: 150px; color: #39C; font-size: 18px; font-weight: bold;">
                                        Connect</span><br />
                                    <span class="AboutTextClass">Stay in touch with others in same vocation and industry</span>
                                </td>
                                <td align="left" class="AboutTextClass">
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <img src="Images/img-home2.png" height="60" width="60" />
                                </td>
                                <td align="left">
                                    <span style="font-family: Arial; width: 150px; color: #39C; font-size: 18px; font-weight: bold;">
                                        Exchange Opinions</span>
                                    <br />
                                    <span class="AboutTextClass">Find the people & knowledge you need to achieve your goal</span>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <img src="Images/img-home3.png" height="60" width="60" />
                                </td>
                                <td align="left">
                                    <span style="font-family: Arial; width: 150px; color: #39C; font-size: 18px; font-weight: bold;">
                                        Seek Guidance</span>
                                    <br />
                                    <span class="AboutTextClass">Seek guidance from others on problems or vexing issues</span>
                                </td>
                            </tr>
                            <%--<tr>
                                <td>
                                    <img src="Images/img-home1.png" height="60" width="60" />
                                </td>
                                <td>
                                </td>
                                <td class="AboutTextClass">
                                    Create your mentors
                                </td>
                            </tr>--%>
                        </table>
                    </div>
                    <div id="registration">
                        <%-- <asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="upRegistration">
                            <ProgressTemplate>
                                <div id="pageLoading">
                                    <center>
                                        <img src="Images/loading-small.jpg" alt="loading" width="25" height="25" />
                                        <span style="color: #1C6F93; font-size: 13px;">Please wait... </span>
                                    </center>
                                    <div id="transparentBg" class="transparentBg">
                                    </div>
                                </div>
                            </ProgressTemplate>
                        </asp:UpdateProgress>--%>
                        <asp:UpdatePanel ID="upRegistration" runat="server" UpdateMode="Conditional">
                            <ContentTemplate>
                                <div class="ui-widget">
                                    <asp:ValidationSummary ID="ValidationSummary1" runat="server" CssClass="ui-state-error ui-corner-all"
                                        EnableClientScript="true" DisplayMode="List" />
                                    <div id="idSpanMsg" runat="server" class="successMsg" visible="false">
                                    </div>
                                </div>
                                <div class="head">
                                    Join MyVocationspace Today
                                </div>
                                <div>
                                    <table cellpadding="5">
                                        <tr>
                                            <td align="right" class="tdFormLabel" style="width: 90px">
                                                First Name :
                                            </td>
                                            <td>
                                                <asp:TextBox ID="txtFname" runat="server" MaxLength="30" SkinID="default"></asp:TextBox>
                                                <asp:RequiredFieldValidator ID="rftxtFname" runat="server" Text="*" ErrorMessage="Please enter First name."
                                                    ControlToValidate="txtFname" ForeColor="Red" Display="Dynamic"></asp:RequiredFieldValidator>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td align="right" class="tdFormLabel" style="width: 90px">
                                                Last Name :
                                            </td>
                                            <td>
                                                <asp:TextBox ID="txtLname" runat="server" MaxLength="30" SkinID="default"></asp:TextBox>
                                                <asp:RequiredFieldValidator ID="rfvtxtLname" runat="server" Text="*" ErrorMessage="Please enter Last name."
                                                    ControlToValidate="txtLname" ForeColor="Red" Display="Dynamic"></asp:RequiredFieldValidator>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td align="right" class="tdFormLabel">
                                                Email :
                                            </td>
                                            <td>
                                                <asp:TextBox ID="txtEmail" runat="server" MaxLength="30" SkinID="default"></asp:TextBox>
                                                <asp:RequiredFieldValidator ID="rftxtEmail" runat="server" ErrorMessage="Please enter email ID."
                                                    Text="*" ForeColor="Red" ControlToValidate="txtEmail" Display="Dynamic"> </asp:RequiredFieldValidator>
                                                <asp:RegularExpressionValidator ID="retxtemail" ControlToValidate="txtEmail" runat="server"
                                                    ErrorMessage="Please enter valid email Id." Text="*" ForeColor="Red" Display="Dynamic"
                                                    ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*" SetFocusOnError="True"></asp:RegularExpressionValidator>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td align="right" valign="top" class="tdFormLabel">
                                                Password :
                                            </td>
                                            <td>
                                                <asp:TextBox ID="txtPass" runat="server" TextMode="Password" MaxLength="15" SkinID="default"></asp:TextBox>
                                                <asp:RequiredFieldValidator ID="rePass" runat="server" ControlToValidate="txtPass"
                                                    ErrorMessage="Please enter password." ForeColor="Red" Text="*" Display="Dynamic"></asp:RequiredFieldValidator>
                                                <asp:RegularExpressionValidator ID="regPass" runat="server" ControlToValidate="txtPass"
                                                    ErrorMessage="Please enter valid passwod." ForeColor="Red" Text="*" Display="Dynamic"
                                                    ValidationExpression="(?!^[0-9]*$)(?!^[a-zA-Z]*$)^([a-zA-Z0-9@\$]{8,20})$"></asp:RegularExpressionValidator>
                                                <div class="smallformmsg">
                                                    Alphanumeric 8 or more characters
                                                </div>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td align="right" class="tdFormLabel">
                                                Select Country :
                                            </td>
                                            <td>
                                                <asp:DropDownList ID="ddlCountry" SkinID="ddlSmall" runat="server">
                                                </asp:DropDownList>
                                                <asp:RequiredFieldValidator ID="rfdllCountry" runat="server" ErrorMessage="Please select country."
                                                    Display="Dynamic" Text="*" InitialValue="-1" ForeColor="Red" ControlToValidate="ddlCountry"></asp:RequiredFieldValidator>
                                            </td>
                                        </tr>
                                        <%--<tr>
                                            <td align="right" class="tdFormLabel">
                                                Select Industry :
                                            </td>
                                            <td>
                                                <asp:DropDownList ID="ddlIndustry" runat="server">
                                                </asp:DropDownList>
                                                <asp:RequiredFieldValidator ID="rfddlInd" runat="server" ErrorMessage="Please select industry."
                                                    Display="Dynamic" Text="*" InitialValue="-1" ForeColor="Red" ControlToValidate="ddlIndustry"></asp:RequiredFieldValidator>
                                            </td>
                                        </tr>--%>
                                        <tr>
                                            <td colspan="2" align="center">
                                                <asp:UpdatePanel runat="server" ID="updateButton">
                                                    <ContentTemplate>
                                                        <asp:Button ID="btnSubmit" runat="server" Text="Join Now" CssClass="formBtnEdit"
                                                            OnClick="btnSubmit_Click" />
                                                    </ContentTemplate>
                                                </asp:UpdatePanel>
                                                <asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="updateButton">
                                                    <ProgressTemplate>
                                                        <div id="pageLoading">
                                                            <center>
                                                                <img src="Images/loading-small.jpg" alt="loading" width="25" height="25" />
                                                                <span style="color: #1C6F93; font-size: 13px;">Please wait... </span>
                                                            </center>
                                                            <div id="transparentBg" class="transparentBg">
                                                            </div>
                                                        </div>
                                                    </ProgressTemplate>
                                                </asp:UpdateProgress>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td colspan="2" align="center" class="smallformmsg">
                                                Already on MyVocationSpace? <a href="Login.aspx?log=1" onclick="$(document.body).animate({top:'0'},5000);">
                                                    Sign in.</a>
                                                <br />
                                                <span><a href="javascript:void(0)" id="lnkForgotPswd" onclick="popup('PassPopup','blanket','0'); return false;">
                                                    Forgot password?</a></span>
                                            </td>
                                        </tr>
                                        <%--<tr>
                                            <td colspan="2" align="center" class="smallformmsg">
                                                
                                            </td>
                                        </tr>--%>
                                    </table>
                                </div>
                            </ContentTemplate>
                            <Triggers>
                                <asp:AsyncPostBackTrigger ControlID="btnSubmit" EventName="Click" />
                            </Triggers>
                        </asp:UpdatePanel>
                    </div>
                    <div style="clear: both">
                    </div>
                    <div id="Search-box">
                        <div style="width: 255px" class="small-boldhead">
                            Search for someone by Vocation:
                        </div>
                        <div style="width: 150px">
                            <asp:TextBox ID="txtIndustry" runat="server" Text="Enter industry name" onfocus="if(this.value=='Enter industry name')this.value='';this.style.color='#000';"
                                onblur="if(this.value=='')this.value='Enter industry name';this.style.color='#ccc';"
                                ForeColor="#cccccc"></asp:TextBox>
                        </div>
                        <div style="width: 150px">
                            <asp:TextBox ID="txtVocation" runat="server" Text="Enter vocation" onfocus="if(this.value=='Enter vocation')this.value='';this.style.color='#000';"
                                onblur="if(this.value=='')this.value='Enter vocation';this.style.color='#ccc';"
                                ForeColor="#cccccc"></asp:TextBox>
                        </div>
                        <div style="width: 40px">
                            <asp:Button ID="btnGo" runat="server" Text="Go" Height="24px" CssClass="formBtnEdit"
                                CausesValidation="false" OnClientClick="return validateGo();" OnClick="btnGo_Click" />
                        </div>
                        <div style="width: 160px">
                            <span id="spanGoErr" style="display: none; font-family: Arial; color: #CD0A0A;">
                            </span>
                        </div>
                        <div style="clear: both">
                        </div>
                        <div class="smallformmsg">
                            <center>
                                Browse members <a href="javascript:void(0)" onclick="popup('PopupListpopup','PopupListBlanket','0');PopupList(1);return false;">
                                    by Industry</a> or <a href="javascript:void(0)" onclick="popup('PopupListpopup','PopupListBlanket','0');PopupList(0);return false;">
                                        by vocation</a></center>
                        </div>
                    </div>
                </div>
            </center>
        </div>
        <div style="clear: both">
        </div>
        <div>
            <uc1:footer runat="server" ID="footer"></uc1:footer>
        </div>
    </center>
    <center>
        <div id="PopupListBlanket" style="display: none;" class="blanket">
        </div>
        <div id="PopupListpopup" style="display: none; height: 400px; width: 650px; left: 20%;"
            class="Popup">
            <table cellpadding="5px" border="0">
                <tr>
                    <td align="left" colspan="4" style="padding: 0">
                        <table style="height: 100%">
                            <tr>
                                <td style="width: 550px" align="left">
                                    <span></span>
                                </td>
                                <td style="width: 20px" align="center">
                                </td>
                                <td style="width: 5px">
                                </td>
                                <td align="right" style="white-space: nowrap; background-color: White; width: 10px"
                                    valign="middle">
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr>
                    <td class="head-strip">
                        <span id="List-Head"></span><span style="float: right"><a href="javascript:void(0)"
                            onclick="$('#PopupListpopup').fadeOut('slow');$('#PopupListBlanket').fadeOut('slow');"
                            runat="server" id="A3" style="color: white; border: 0">
                            <img alst="" src="Images/close.png" width="20px" align="right" height="20px" style="border: 0"
                                title="Close" />
                        </a></span>
                    </td>
                </tr>
                <tr>
                    <td style="padding-left: 30px">
                        Search:
                        <asp:TextBox ID="txtSearch" runat="server"></asp:TextBox>
                        <asp:Button ID="btnSearch" runat="server" Text="Search" OnClientClick="PopupList('');return false;"
                            CausesValidation="false" class="formBtnEdit" />
                    </td>
                </tr>
                <tr>
                    <td>
                        <hr />
                    </td>
                </tr>
                <tr>
                    <td align="center">
                        <div id="PopupList" style="overflow-x: hidden; overflow-y: scroll; height: 250px;">
                            <img src="Images/lightbox-ico-loading.gif" id="loading" alt="Please wait.." style="display: none" />
                        </div>
                    </td>
                </tr>
            </table>
        </div>
        <div name="light" runat="server" id="blanket" style="display: none;" class="blanket">
        </div>
        <div id="PassPopup" style="display: none;" class="Popup">
            <table cellpadding="5px" border="0">
                <tr>
                    <td align="left" colspan="4" style="padding: 0">
                        <table style="height: 100%">
                            <tr>
                                <td style="width: 480px" align="left">
                                    <span>Forgot Password</span>
                                </td>
                                <td style="width: 20px" align="center">
                                </td>
                                <td style="width: 5px">
                                </td>
                                <td style="width: 10px; white-space: nowrap; background-color: White;" align="right"
                                    valign="middle">
                                    <a href="javascript:void(0)" onclick="$('#PassPopup').fadeOut('slow');$('#blanket').fadeOut('slow');document.getElementById('txtEmailAdd').value='';document.getElementById('ErrorDiv').style.display='none';toggleDiv('div7', 0);"
                                        runat="server" id="lnkClose" style="color: white; border: 0">
                                        <img alt="" src="Images/blue-close-button.png" align="right" style="border: 0" title="Close" />
                                    </a>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="4">
                                    <hr style="color: #CCCCB2" />
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr>
                    <td style="color: Black; font-size: 12px; font-weight: bold;" align="right">
                        Email ID:
                    </td>
                    <td align="left">
                        <span style="float: left; padding-right: 5px">
                            <input type="text" id="txtEmailAdd" maxlength="100" onfocus="toggleDiv('div7', 0);"
                                style="width: 180px" /></span><span style="float: left">
                                    <div id="div7" class="errorDiv">
                                    </div>
                                </span>
                    </td>
                </tr>
                <tr>
                    <td colspan="2" align="center">
                        <div id="Div1" style="display: none; padding-right: 70px">
                            <img src="Images/loading.gif" alt="" height="30px" width="30px" />Please wait...</div>
                    </td>
                </tr>
                <tr>
                    <td align="center" colspan="2" style="padding-right: 90px">
                        <input type="button" id="Button1" value="SUBMIT" onclick="sendPassword();" class="formBtnEdit" />
                    </td>
                </tr>
                <tr>
                    <td align="left" colspan="2" style="width: 100%; padding-left: 60px">
                        <div id="ErrorDiv" class="validatorerrorDiv" style="display: none;">
                        </div>
                    </td>
                </tr>
            </table>
        </div>
    </center>
    </form>
</body>
</html>
